package com.beifu.manager.service.role;

import com.beifu.manager.model.Role;
import com.beifu.manager.model.RoleExample;
import com.beifu.manager.model.RoleModule;
import com.beifu.manager.model.UserRoleRelation;
import com.mds.manager.utils.PageUtils;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleService {

    public List<Role> selectByExample(RoleExample roleExample);

    int countByExample(RoleExample example);

    int deleteByExample(RoleExample example);

    int deleteByPrimaryKey(int id);

    void insert(Role record, List<UserRoleRelation> roleUserList, List<RoleModule> rolePermissionList);

    int insertSelective(Role record);

    Role selectByPrimaryKey(int id);

    int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    /**
     * 获取角色分页信息
     * @param Page
     * @return
     */
    public PageUtils getRolePage(PageUtils Page);

    /**
     * 批量删除角色
     * @param ids
     * @return
     */
    int batchDelRole(String[] ids);


    /**
     * 更新角色、权限、角色下用户
     */
    void updateRoleUserPermission(Role record, List<UserRoleRelation> roleUserList, List<RoleModule> rolePermissionList);
}
